﻿using Network.UpdateData;
using System.Net.Sockets;

namespace SFJDService.SocketHandle
{
    /// <summary>
    /// UDP, code: 1301
    /// (Recive端)接收到发送文件的请求，如果是发给本客户端的，则在接收列表里删掉对应的任务，然后给发送端ip地址回复指令
    /// 发送格式： transport GUID
    /// </summary>
    class PH05ReGotRequest : PacketHandle
    {
        public PH05ReGotRequest(Socket socket, Packet packet) : base(socket, packet)
        {
        }

        protected override void Handle()
        {
            for (int i = 0; i < Runtime.transportReceive.Count; i++)
            {
                string[] ss = Runtime.transportReceive[i].Split('♠');
                if (ss[1].Equals(Message))
                {
                    Runtime.transportReceive.RemoveAt(i);
                }
            }
            Runtime.transportReceive.Add(GetIpSend() + '♠' + Message + '♠');
            //Launcher.SendTcp(typeof(PH05SeRequestReply).GetDictianaryKey(), GetIpSend(), Message);
            Launcher.SendMsg2One(typeof(PH05SeRequestReply).GetDictianaryKey(), guidSend, Message);
        }
    }
}
